<%@page import="com.core.ui.controller.ActionBarController"%>
<%@page import="com.entities.user.actionscript.ActionScriptParserUserOpen"%>
<%@page import="com.entities.user.list.UserListController"%>
<%@page import="com.core.managers.SessionManager"%>
<%@page import="com.core.utils.GlobalConstants"%>
<%@taglib prefix="sorokina" uri="/WEB-INF/Sorokina.tld"%>
<script type="text/javascript">
function deleteUser(userId){
    var confirmResult = confirm("Are you sure to delete User?");
    if (confirmResult){

        jQuery.post('<%=GlobalConstants.SERVLET_USERDELETE%>
	', {
				'id' : userId
			}, function(data) {
				location.reload();
			});

		}
	}
</script>

<%
	SessionManager.addContext(GlobalConstants.USERCONTEXT_USER);
            SessionManager.addContext(GlobalConstants.USERCONTEXT_USERSLIST);
	String userId = request.getParameter("id");

	UserListController userListController = new UserListController();

	ActionScriptParserUserOpen userActionScriptParser = new ActionScriptParserUserOpen();
	userActionScriptParser.setUserId(userId);

	ActionBarController actionBarController = new ActionBarController();
	actionBarController.setActionScriptParser(userActionScriptParser);
%>


<div>

    <sorokina:ActionBarView datasource="<%=actionBarController %>" />

    <sorokina:TableView datasource="<%=userListController%>" delegate="<%=userListController%>" />

</div>